package cn.icyzx.configure;


import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;


/**
 * Created by zk on 2016/11/12.
 * 这里试试不再用xml的方式来配置spring,转而采用java 配置类
 * AbstractAnnotationConfigDispatcherServletInitializer类，是被spring实现的能自动加载配置类
 * RootConfig 是配置spring上下文，WebConfigure是配置dispatcherServlet上下文
 * getServletMappings 拦截"/"下的所有请求
 */
public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    protected Class<?>[] getRootConfigClasses() {
        return new Class<?>[]{RootConfig.class, MybatisConfigure.class};
    }

    protected Class<?>[] getServletConfigClasses() {
        return new Class<?>[]{WebConfigure.class};
    }

    protected String[] getServletMappings() {
        return new String[]{"/"};
    }


}
